package com.dao;

import com.entity.ClassRoom;
import org.apache.ibatis.annotations.*;

public interface ClassRoomMapper {

    //根据班级编号查询班级信息
    @Select("select * from classroom where cid = #{cid}")
    public ClassRoom getClassRoomByCid(Integer cid);

    //根据班级编号查询带学生集合信息的班级资料
    @Select("select * from classroom where cid = #{cid}")
    @Results({
          @Result(property = "cid",column = "cid"),
          @Result(property = "stus",column = "cid",javaType = java.util.Set.class,many=@Many(select = "com.dao.StudentsMapper.getStudentsByClassRoomId"))
    })
    public ClassRoom getClassRoomWithStudentsByCid(Integer cid);
}
